import JsonToXml from "./src/utils/JsonToXml";
import {Analyser} from "./src/analyser/Analyser";
import Tokenizer from "./src/tokenizer/Tokenizer";
import StringIter from "./src/tokenizer/StringIter";


export function jsonToXml(json: Object) {
    return JsonToXml("root", {
        data: json
    });
}

export function xmlToJson(xml: string) {
    const analyser = new Analyser(new Tokenizer(new StringIter(xml)));
    //@ts-ignore
    return analyser.analyseAllTag().value.data;
}